const state = {
  globMsg: 1
}

const mutations = {
  ADD_MSG: (state) => {
    state.globMsg += 1
  },
  DECREMENT_MSG: (state) => {
    state.globMsg -= 1
  }
}

const actions = {
  addMsg({ commit }) {
    commit('ADD_MSG')
  },
  decrementMsg({ commit }) {
    commit('DECREMENT_MSG')
  }
}

const getters = {
  myGlobMsg(state) {
    return `当前获取 globMsg => ${state.globMsg}`
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
